package com.patttern.creativity.singlenton;

/**
 * @Author: root
 * @Date: 2018/12/3 21:10
 * 懒汉单例模式
 */
public class Singleton02 {
    private static Singleton02 instance = null;

    private Singleton02() {
    }

    public static synchronized Singleton02 getInstance() {
        if (instance == null) {
            instance = new Singleton02();
        }
        return instance;
    }
}
